package ProducerConsumer_Mantou;

/**
 * Created by key on 2015/3/1.
 */
public class Consumer implements Runnable{
    StackBasket ss = new StackBasket();
    Consumer(StackBasket ss){
        this.ss = ss;
    }

    public void run(){
        for(int i =0;i<20;i++){
            Mantou m = ss.pop();

            try{
                Thread.sleep((int)(Math.random()*1000));
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
